
package com.intretech.umsin.demo.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.intretech.umsin.common.annotation.Dict;
import com.intretech.umsin.common.excel.converter.LocalDateTimeConverter;
import com.intretech.umsin.datasource.codemapping.annotations.CodeMappingConfig;
import com.intretech.umsin.datasource.codemapping.entity.Assignment;
import com.intretech.umsin.demo.entity.UserEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
* @version V1.0
* 订单:order 对应的VO模型类.
* @ClassName: OrderVo
* @Description: 订单:order 对应的VO模型类.
* @author: 李启联
* @date:   2022-5-5 21:42:13
* @Copyright: Copyright (c) 2022
*/
@ApiModel("订单")
@ExcelIgnoreUnannotated
public class OrderVo implements Assignment, Serializable {

    // 主键id
    @ApiModelProperty(value = "主键id" ,dataType="varchar(64)" ,required= true)
    @ExcelProperty(value = "主键id")
    private Long id;

    // 订单编码
    @ApiModelProperty(value = "订单编码" ,dataType="varchar(64)" ,required= false)
    @ExcelProperty(value = "订单编码")
    private String orderNo;

    // 客户ID
    @ApiModelProperty(value = "客户ID" ,dataType="varchar(64)" ,required= false)
    @ExcelProperty(value = "客户ID")
    private String customerId;

    // 收货人ID
    @ApiModelProperty(value = "收货人ID" ,dataType="varchar(64)" ,required= false)
    @ExcelProperty(value = "收货人ID")
    private String receiverId;

    // 订单状态
    @ApiModelProperty(value = "订单状态" ,dataType="int(10)" ,required= false)
    @ExcelProperty(value = "订单状态")
    private Integer orderStatus;

    // 版本号
    @ApiModelProperty(value = "版本号" ,dataType="int(10)" ,required= false)
    @ExcelProperty(value = "版本号")
    private Integer version;

    // 租户ID
    @ApiModelProperty(value = "租户ID" ,dataType="varchar(64)" ,required= false)
    @ExcelProperty(value = "租户ID")
    private String tenantId;

    // 创建人
    @ApiModelProperty(value = "创建人" ,dataType="varchar(64)" ,required= false)
    @ExcelProperty(value = "创建人")
    @Dict(dictTable = "user",dicCode = "id",dicText = "name")
    private String creator;

    @CodeMappingConfig(fieldCodeProperty = "creator",targetClass = UserEntity.class,targetClassKeyProperty = "id",targetClassFieldProperty = "name")
    private String createName;


    // 修改人
    @ApiModelProperty(value = "修改人" ,dataType="varchar(64)" ,required= false)
    @ExcelProperty(value = "修改人")
    @Dict(dictTable = "user",dicCode = "id",dicText = "name")
    private String modifier;

    @CodeMappingConfig(fieldCodeProperty = "modifier",targetClass = UserEntity.class,targetClassKeyProperty = "id",targetClassFieldProperty = "name")
    private String modifierName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    // 创建时间
    @ApiModelProperty(value = "创建时间" ,dataType="datetime()" ,required= false)
    @ExcelProperty(value = "创建时间",converter = LocalDateTimeConverter.class)
    private java.time.LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    // 修改时间
    @ApiModelProperty(value = "修改时间" ,dataType="datetime()" ,required= false)
    @ExcelProperty(value = "修改时间",converter = LocalDateTimeConverter.class)
    @DateTimeFormat("yyyy-MM-dd")
    private java.time.LocalDateTime modifyTime;

    public Long getId(){
    return this.id;
    }

    public void setId(Long id){
    this.id = id;
    }
    public String getOrderNo(){
    return this.orderNo;
    }

    public void setOrderNo(String orderNo){
    this.orderNo = orderNo;
    }
    public String getCustomerId(){
    return this.customerId;
    }

    public void setCustomerId(String customerId){
    this.customerId = customerId;
    }
    public String getReceiverId(){
    return this.receiverId;
    }

    public void setReceiverId(String receiverId){
    this.receiverId = receiverId;
    }
    public Integer getOrderStatus(){
    return this.orderStatus;
    }

    public void setOrderStatus(Integer orderStatus){
    this.orderStatus = orderStatus;
    }
    public Integer getVersion(){
    return this.version;
    }

    public void setVersion(Integer version){
    this.version = version;
    }
    public String getTenantId(){
    return this.tenantId;
    }

    public void setTenantId(String tenantId){
    this.tenantId = tenantId;
    }
    public String getCreator(){
    return this.creator;
    }

    public void setCreator(String creator){
    this.creator = creator;
    }
    public String getModifier(){
    return this.modifier;
    }

    public void setModifier(String modifier){
    this.modifier = modifier;
    }
    public java.time.LocalDateTime getCreateTime(){
    return this.createTime;
    }

    public void setCreateTime(java.time.LocalDateTime createTime){
    this.createTime = createTime;
    }
    public java.time.LocalDateTime getModifyTime(){
    return this.modifyTime;
    }

    public void setModifyTime(java.time.LocalDateTime modifyTime){
    this.modifyTime = modifyTime;
    }

    public String getCreateName() {
        return createName;
    }

    public void setCreateName(String createName) {
        this.createName = createName;
    }

    public String getModifierName() {
        return modifierName;
    }

    public void setModifierName(String modifierName) {
        this.modifierName = modifierName;
    }

    public OrderVo(){
    }


    @Override
    public String toString() {
        return "OrderVo{" +
                "id='" + id + '\'' +
                ", orderNo='" + orderNo + '\'' +
                ", customerId='" + customerId + '\'' +
                ", receiverId='" + receiverId + '\'' +
                ", orderStatus=" + orderStatus +
                ", version=" + version +
                ", tenantId='" + tenantId + '\'' +
                ", creator='" + creator + '\'' +
                ", createName='" + createName + '\'' +
                ", modifier='" + modifier + '\'' +
                ", modifierName='" + modifierName + '\'' +
                ", createTime=" + createTime +
                ", modifyTime=" + modifyTime +
                '}';
    }
}